<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>计量单位</title>
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/dtree.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/font/dtreefont.css"/>
    <link rel="stylesheet" href="../../assets/module/admin.css?v=313"/>
    <link rel="stylesheet" href="../../assets/css/publicStyle.css"/>
    <!--[if lt IE 9]>
    <script src="../../assets/libs/html5shiv.min.js"></script>
    <script src="../../assets/libs/respond.min.js"></script>
    <![endif]-->
    <style>
        #idenGroupPageBox,#idenValuePageBox{
            float: right;
        }
        .layui-form-select .layui-edge{
            right: 35px;
        }
        .moveMenu-box{
            margin:15px;
        }
        #unitGroup-tmpl-box,#unitValue-tmpl-box{
            display: inline-block;
        }
        #idenGroupPageBox .layui-laypage,#idenValuePageBox .layui-laypage{
            margin: 0;
        }
    </style>

<body class="layui-layout-body hide-body-title">
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-row">
                <div class="layui-col-xs6 layui-col-md6 layui-col-lg6">
                    <div class="layui-card-body">
                        <div class="layui-card-header">单位分组</div>
                        <div class="layui-row">
                            <div id="unitGroup-tmpl-box"></div>
                            <div id="idenGroupPageBox"></div>
                        </div>
                        <table class="layui-table" id="unitGroup" lay-filter="unitGroup" lay-skin="nob"></table>
                    </div>
                </div>
                <div class="layui-col-xs6 layui-col-md6 layui-col-lg6">
                    <div class="layui-card-body">
                        <div class="layui-card-header">
                            单位值
                        </div>
                        <div class="layui-row">
                            <div id="unitValue-tmpl-box"></div>
                            <div id="idenValuePageBox"></div>
                        </div>
                        <table class="layui-table" id="unitValue" lay-filter="unitValue" lay-skin="nob"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 单位分组权限模板 -->
<script type="text/tmpl" id="unitGroup-tmpl">
    {{ if hasPower("/meta/unit-group:add")}}
    <button id="addUnitGroup" class="layui-btn layui-btn-default layui-btn-sm"><i class="layui-icon"></i>新增</button>
    {{/if}}
</script>

<!-- 单位值权限模板 -->
<script type="text/tmpl" id="unitValue-tmpl">
    {{ if hasPower("/meta/unit-value:add")}}
    <button id="addUnitValue" class="layui-btn layui-btn-default layui-btn-sm"><i class="layui-icon"></i>新增</button>
    {{/if}}
</script>

<script type="text/html" id="unitGroup-table-tmpl-box">
</script>

<!-- 单位分组表格操作列 -->
<script type="text/tmpl" id="unitGroup-table-tmpl">
    {{ if hasPower("/meta/unit-group:edit")}}
    <a class="layui-btn layui-btn-xs layui-btn-warning" lay-event="editGroup">编辑</a>
    {{/if}}
    {{ if hasPower("/meta/unit-group:delete")}}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delGroup">删除</a>
    {{/if}}
</script>

<script type="text/html" id="unitValue-table-tmpl-box">
</script>
<!-- 单位值表格操作列 -->
<script type="text/tmpl" id="unitValue-table-tmpl">
    {{ if hasPower("/meta/unit-value:edit")}}
    <a class="layui-btn layui-btn-xs layui-btn-warning" lay-event="editValue">编辑</a>
     {{/if}}
    {{ if hasPower("/meta/unit-value:moveGroup")}}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="moveMenu">移动目录</a>
     {{/if}}
    {{ if hasPower("/meta/unit-value:delete")}}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delValue">删除</a>
     {{/if}}
</script>


<!--新增单位分组弹窗-->
<script type="text/html" id="addUnitGroupModel">
    <form id="addUnitGroupForm" lay-filter="modelUserForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input name="cnname" placeholder="请输入名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea" maxlength="20"
                          lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitUser" lay-submit>确定</button>
        </div>
    </form>
</script>

<!--编辑单位分组弹窗-->
<script type="text/html" id="editUnitGroupModel">
    <form id="editUnitGroupForm" lay-filter="modelUserForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input name="cnname" placeholder="请输入名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea" maxlength="20"
                          lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitUser" lay-submit>确定</button>
        </div>
    </form>
</script>

<!--新增单位值弹窗-->
<script type="text/html" id="addUnitValueModel">
    <form id="addMenuValueForm" lay-filter="modelUserForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">中文名称</label>
            <div class="layui-input-block">
                <input name="cnname" placeholder="请输入中文名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">英文名称</label>
            <div class="layui-input-block">
                <input name="enname" placeholder="请输入英文名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">值类型</label>
            <div class="layui-input-block" id="roleName-box">
                <select name="valueType" lay-filter="aihao" id="unitValueType" placeholder="请选择值类型">

                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea" maxlength="20"
                          lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modleAddValue" lay-submit>确定</button>
        </div>
    </form>
</script>

<!--渲染值类型-->
<script type="text/tmpl" id="template-unitsValue-index-tmpl">
     {{each unitsValue}}
        <option value="{{$value.value}}">{{$value.key}}</option>
    {{/each}}
</script>

<!--编辑单位值弹窗-->
<script type="text/html" id="editUnitValueModel">
    <form id="editMenuValueForm" lay-filter="modelUserForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">中文名称</label>
            <div class="layui-input-block">
                <input name="cnname" placeholder="请输入中文名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">英文名称</label>
            <div class="layui-input-block">
                <input name="enname" placeholder="请输入英文名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">值类型</label>
            <div class="layui-input-block" id="value-type">
                <select name="valueType" lay-filter="aihao" disabled id="unitEditType" placeholder="请选择值类型">

                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block" id="">
                <input type="checkbox" name="status" value="status" lay-skin="switch" lay-text="可用|不可用" lay-filter="autoplay">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea" maxlength="20"
                          lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="edit-Iden" lay-submit>确定</button>
        </div>
    </form>
</script>

<!-- 移动单位分组目录弹窗 -->
<script type="text/html" id="moveMenuModel">
    <div class="moveMenu-box">
        <div class="layui-form-item layui-row mode-version-table" >
            <table class="layui-table" id="moveMenuTable" lay-filter="moveMenuTable" lay-skin="nob"></table>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="move-group" lay-submit>确定</button>
        </div>
    </div>
</script>

<!-- js部分 -->
<script type="text/javascript" src="../../assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="../../assets/js/common.js?v=313"></script>

<script src="../../assets/libs/template-web.js"></script>
<script src="../../assets/libs/axios.min.js"></script>
<script src="../../assets/js/config.js"></script>
<script src="../../assets/js/authority.js"></script>

<script src="../../assets/js/metadata/idenUnits.js"></script>

</body>

</html>

